1. Field of the Invention
The invention relates to a keypad device and an operation method thereof, and more particularly to a keypad device and a method for reading keypad signals of the keypad device.
2. Description of the Related Art
Of the circuit designs of keypad devices, the direct type and the matrix type are two most common ones. According to the direct type keypad device, keys are directly connected to the GPIO (General Purpose Input Output) pins of a controller wherein the controller determine the statuses of the keys directly. Such a structure is indeed simple and direct. Since each key requires a particular GPIO pin, a large number of GPIO pins will be occupied if a large number of keys are required. As a controller has only a limited number of GPIO pins, it would be unwise to use up all the GPIO pins on keypad circuits. This is the limitation imposed upon the design of the direct type keypad device. It is noteworthy that the direct type keypad device cannot be applied in the circuit design with a great number of keys. Besides, whether or not the input pins of the controller have the interrupt function also needs to be considered. If the pins in service do not have the interrupt function, the controller has to monitor the status of every pin via ceaseless queries in order to determine if a key has been triggered or not. Therefore, the keypad device will occupy a large part of bandwidth and resource of the controller.
In order to reduce the number of GPIO pins needed, the matrix-type keypad device is thus developed. In the design of The matrix-type keypad circuit, crisscross lines are arrangedina matrix, and every key is arranged at a node of an intersection point between a row line and a column line. The status of the key is scanned and then reported to the controller. Since the controller has to continuously scan the status of the matrix composed of the keypad device, The controller needs a specific algorithm to incorporate with the operation of the keypad matrix, consuming additional power and resources of the controller. On the other hand, the column signals and row signals of the matrix circuit are coupled to a number of GPIO pins of the controller. With the number of keys being set at a predetermined number, There is no significant decrease in the number of controller pins required. Thus, the matrix-type keypad device is usually applied in The occasions when the number of keys required is large. For instance, The matrix-type keypad device can be applied in a computer keyboard.
In the application of the PDA (Personal Digital Assistant), the design of the number of keys has to take into account the functional appeals and size of a product. If the matrix-type circuit design is adopted, the required number of GPIO pins of a controller can only be slightly reduced. In addition, the controller will consume more power and system resources to scan the keypad matrix sequentially, which is difficult to be accepted in the application of PDA when battery durability is highly emphasized. On the other hand, if the direct-type circuit design is adopted, as the keys required a large amount of GPIO pins of the controller, the number of pins available for other circuits becomes smaller. This will cause more difficulties in the design of circuits.